<?php
include_once("../modules/checkA.php");
include_once("../../config.php");
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'employee'");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("detail-function.php");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once(ROOT_PATH_.'/controlbase/modules/head.php'); ?>

</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controlbase/modules/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controlbase/modules/sidebar.php'; ?>
        </div>


<div id="content" class="layui-form">
<h1> 员工信息 </h1>



<div class="tips">
更新权限后，需要重新登录后生效。
</div>
<div class="detail-box member-edit-box layui-form">

<div class="detail-boxes">
<ul class="detail-boxing">

<?
$nowpageid = $_GET["nowpageid"];
?>

<form id="edit-member-form" method="post" action="detail-edit-function.php?nav-itemed=employee&nowpageid=<?echo $nowpageid?>" enctype="multipart/form-data" class="layui-form">


 <input type="hidden" name="nid" value="<? echo $detail['nid']?>">


  <div class="layui-form-item">
    <label class="layui-form-label">姓名</label>
    <div class="layui-input-block">
      <input type="text" name="ai_name" required  lay-verify="required" placeholder="请输入名字" autocomplete="off" class="layui-input" value="<? echo $detail['name']?>">
    </div>
  </div>


     <div class="layui-form-item">
    <label class="layui-form-label">教练员</label>
    <div class="layui-input-block">
      <input type="radio" name="ai_coach" value="1" title="是"
	  <? if($detail['coach']=="1"){echo "checked";} ?>
	  >
      <input type="radio" name="ai_coach" value="0" title="否"
	  <? if($detail['coach']=="0"){echo "checked";} ?>
	  >
    </div>
  </div>

    <div class="layui-form-item">
    <label class="layui-form-label">身份证号</label>
    <div class="layui-input-block">
      <input type="text" name="ai_idnumber" placeholder="请输入身份证号" autocomplete="off" class="layui-input" value="<? echo $detail['idnumber']?>">
    </div>

   <div class="layui-form-item">
    <label class="layui-form-label">性别</label>
    <div class="layui-input-block">
      <input type="radio" name="ai_sex" value="男" title="男"
	  <? if($detail['sex']=="男"){echo "checked";} ?>
	  >
      <input type="radio" name="ai_sex" value="女" title="女"
	  <? if($detail['sex']=="女"){echo "checked";} ?>
	  >
    </div>
  </div>


   <div class="layui-form-item">
    <label class="layui-form-label">电话</label>
    <div class="layui-input-block">
      <input type="text" name="ai_phone" placeholder="请输入电话" autocomplete="off" class="layui-input" value="<? echo $detail['phone']?>">
    </div>
  </div>



        <div class="layui-form-item">
            <label class="layui-form-label">备用电话</label>
            <div class="layui-input-block">
                <input type="text" name="ai_phone2" placeholder="请输入备用电话" autocomplete="off" class="layui-input" value="<? echo $detail['phone2']?>">
            </div>
        </div>



        <div class="layui-form-item">
            <label class="layui-form-label">入职日期</label>
            <div class="layui-input-block">

                <input type="text" name="ai_applydate" id="date" autocomplete="off" class="layui-input"  value="<? echo $detail['applydate']?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="laydate-icon">
            </div>
        </div>



        <div class="layui-form-item">
            <label class="layui-form-label">离职日期</label>
            <div class="layui-input-block">

                <input type="text" name="ai_leavedate" id="date" autocomplete="off" class="layui-input"  value="<? echo $detail['leavedate']?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="laydate-icon">
            </div>
        </div>




        <div class="layui-form-item">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-block">

                <input type="text" name="ai_birthday" id="date" autocomplete="off" class="layui-input"  value="<? echo $detail['birthday']?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" class="laydate-icon">
            </div>
        </div>




        <div class="layui-form-item">
            <label class="layui-form-label">身份证地址</label>
            <div class="layui-input-block">
                <input type="text" name="ai_idaddress" placeholder=" " autocomplete="off" class="layui-input" value="<?echo $detail['idaddress'] ?>">
            </div>
        </div>



        <div class="layui-form-item">
            <label class="layui-form-label">常住地址</label>
            <div class="layui-input-block">
                <input type="text" name="ai_liveaddress" placeholder=" " autocomplete="off" class="layui-input" value="<?echo $detail['liveaddress'] ?>">
            </div>
        </div>



        <div class="layui-form-item">
            <label class="layui-form-label">学历</label>
            <div class="layui-input-block">
                <select name="ai_xueli" >

                    <option value="<?echo $detail['xueli']?>"><?echo $detail['xueli']?></option>
                    <option value="小学">小学</option>
                    <option value="初中">初中</option>
                    <option value="高中">高中</option>
                    <option value="中专">中专</option>
                    <option value="技校">技校</option>
                    <option value="大专">大专</option>
                    <option value="大学">大学</option>
                    <option value="本科">本科</option>
                    <option value="研究生">研究生</option>
                    <option value="学士">学士</option>
                    <option value="硕士">硕士</option>
                    <option value="博士">博士</option>
                    <option value="博士后">博士后</option>

                </select>
            </div>
        </div>





        <?$driverlicense=explode(",", $detail['driverlicense']);?>


        <div class="layui-form-item">
            <label class="layui-form-label">准驾车型</label>
            <div class="layui-input-block">
                <input type="checkbox" name="ai_driverlicense[]" value="A1" title="A1" <?if(in_array("A1",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="A2" title="A2" <?if(in_array("A2",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="A3" title="A3" <?if(in_array("A3",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="B1" title="B1" <?if(in_array("B1",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="B2" title="B2" <?if(in_array("B2",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="C1" title="C1" <?if(in_array("C1",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="C2" title="C2" <?if(in_array("C2",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="C3" title="C3" <?if(in_array("C3",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="C4" title="C4" <?if(in_array("C4",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="D" title="D" <?if(in_array("D",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="E" title="E" <?if(in_array("E",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="F" title="F" <?if(in_array("F",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="M" title="M" <?if(in_array("M",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="N" title="N" <?if(in_array("N",$driverlicense)){echo "checked";}?> >
                <input type="checkbox" name="ai_driverlicense[]" value="P" title="P" <?if(in_array("P",$driverlicense)){echo "checked";}?> >
            </div>
        </div>


        <?$license=explode(",", $detail['license']);?>
        <div class="layui-form-item">
            <label class="layui-form-label">教员资格</label>
            <div class="layui-input-block">
                <input type="checkbox" name="ai_license[]" value="A1" title="A1" <?if(in_array("A1",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="A2" title="A2" <?if(in_array("A2",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="A3" title="A3" <?if(in_array("A3",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="B1" title="B1" <?if(in_array("B1",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="B2" title="B2" <?if(in_array("B2",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="C1" title="C1" <?if(in_array("C1",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="C2" title="C2" <?if(in_array("C2",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="C3" title="C3" <?if(in_array("C3",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="C4" title="C4" <?if(in_array("C4",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="D" title="D" <?if(in_array("D",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="E" title="E" <?if(in_array("E",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="F" title="F" <?if(in_array("F",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="M" title="M" <?if(in_array("M",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="N" title="N" <?if(in_array("N",$license)){echo "checked";}?> >
                <input type="checkbox" name="ai_license[]" value="P" title="P" <?if(in_array("P",$license)){echo "checked";}?> >
            </div>
        </div>











        <? $department_list=select_lines_all_items($table_Prefix."department","nid desc","","0"); ?>

   <div class="layui-form-item">
    <label class="layui-form-label">部门</label>
    <div class="layui-input-block">
      <select name="ai_departmentid" >

<? $department=select_one_line_all_items($table_Prefix."department","nid = '".$detail['departmentid']."'")?>
        <option value="<? echo $detail['departmentid']?>" ><?echo $department['name']?></option>
		<?for($i=0;$i<count($department_list);$i++){?>

        <option value="<? echo $department_list[$i]['nid'] ?>"><? echo $department_list[$i]['name'] ?></option>
		<? } ?>
      </select>
    </div>
  </div>



        <div class="layui-form-item">
            <label class="layui-form-label">岗位</label>
            <div class="layui-input-block">
                <input type="text" name="ai_position" placeholder="请输职员所在岗位" autocomplete="off" class="layui-input" value="<? echo $detail['position']?>">
            </div>
        </div>




        <div class="layui-form-item">
    <label class="layui-form-label">登陆权限</label>
    <div class="layui-input-block">

      <input type="radio" name="ai_authority" value="是" title="是"
	  <? if($detail['authority']=="是"){echo "checked";} ?>
	  >
      <input type="radio" name="ai_authority" value="否" title="否"
	  <? if($detail['authority']=="否"){echo "checked";} ?>
	  >
    </div>
  </div>





        <? if(in_array("admin",$quanxian)){?>
        <div class="layui-form-item">
    <label class="layui-form-label">系统权限</label>
    <div class="layui-input-block">

        <? $detail_quanxian=explode(",",$detail['quanxian']);?>


        <input type="checkbox" name="ai_quanxian[]" value="admin" title="管理员权限" <?if(in_array("admin",$detail_quanxian)){echo "checked";}?> >


        <input type="checkbox" name="ai_quanxian[]" value="member" title="学员管理系统" <?if(in_array("member",$detail_quanxian)){echo "checked";}?> >

        <input type="checkbox" name="ai_quanxian[]" value="member-statics" title="学员统计" <?if(in_array("member-statics",$detail_quanxian)){echo "checked";}?> >


            <input type="checkbox" name="ai_quanxian[]" value="department" title="部门管理系统" <?if(in_array("department",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="employee" title="员工管理系统" <?if(in_array("employee",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="finance" title="财务管理系统" <?if(in_array("finance",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="equipment" title="设备管理系统" <?if(in_array("equipment",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="receipt" title="收据管理系统" <?if(in_array("receipt",$detail_quanxian)){echo "checked";}?> >


            <input type="checkbox" name="ai_quanxian[]" value="exam" title="考试进度系统" <?if(in_array("exam",$detail_quanxian)){echo "checked";}?> >

            <input type="checkbox" name="ai_quanxian[]" value="exam1" title="科目一考试管理权限" <?if(in_array("exam1",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="exam2" title="科目二考试管理权限" <?if(in_array("exam2",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="exam3" title="科目三考试管理权限" <?if(in_array("exam3",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="exam4" title="科目四考试管理权限" <?if(in_array("exam4",$detail_quanxian)){echo "checked";}?> >




            <input type="checkbox" name="ai_quanxian[]" value="inventory" title="进销存关系系统" <?if(in_array("inventory",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="material" title="物料管理系统" <?if(in_array("material",$detail_quanxian)){echo "checked";}?> >
            <input type="checkbox" name="ai_quanxian[]" value="course" title="课程管理系统" <?if(in_array("course",$detail_quanxian)){echo "checked";}?> >


    </div>
  </div>
        <?}?>



        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="ai_status" value="在职" title="在职"
                    <? if($detail['status']=="在职"){echo "checked";} ?>
                    >

                <input type="radio" name="ai_status" value="休假" title="休假"
                    <? if($detail['status']=="休假"){echo "checked";} ?>
                    >

                <input type="radio" name="ai_status" value="辞职" title="辞职"
                    <? if($detail['status']=="辞职"){echo "checked";} ?>
                    >
                <input type="radio" name="ai_status" value="辞退" title="辞退"
                    <? if($detail['status']=="辞退"){echo "checked";} ?>
                    >
                <input type="radio" name="ai_status" value="休假" title="休假"
                    <? if($detail['status']=="休假"){echo "checked";} ?>
                    >

                <input type="radio" name="ai_status" value="带薪假期" title="带薪假期"
                    <? if($detail['status']=="带薪假期"){echo "checked";} ?>>
            </div>
        </div>




        <div class="layui-form-item">
            <label class="layui-form-label">工资</label>
            <div class="layui-input-block">
                <input type="text" name="ai_salary" placeholder="请输入基本工资" autocomplete="off" class="layui-input" value="<? echo $detail['salary']?>">
            </div>
        </div>




    <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">备注</label>
    <div class="layui-input-block">
      <textarea name="ai_remark" placeholder="备注" class="layui-textarea"><? echo $detail['remark']?></textarea>
    </div>
  </div>










  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>



<input name="sys_part" type="hidden" value="<? echo $system_part ?>"/>
<input name="nowpageid" type="hidden" value="<? echo $_REQUEST['nowpageid'] ?>"/>
<input name="sortby" type="hidden" value="<? echo $_REQUEST['sortby'] ?>"/>



</form>








</ul>
</div>
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>


<?php include_once('../modules/footer.php'); ?> </body>
</html>
